package di.module;

import androidx.lifecycle.ViewModel;
import androidx.lifecycle.ViewModelProvider;

import dagger.Binds;
import dagger.Module;
import dagger.multibindings.IntoMap;
import di.scope.ViewModelKey;
import viewmodel.OauthViewModel;
import viewmodel.ProfileViewModel;
import viewmodel.RedPackViewModel;
import viewmodel.ViewModelFactory;
import viewmodel.WalletViewModel;

@Module
public abstract class ViewModelModule {

  /*@Binds
  abstract ViewModelProvider.Factory bindViewModelFactory(ViewModelProvider.AndroidViewModelFactory factory);
*/
  @Binds
  abstract ViewModelProvider.Factory bindViewModelFactory(ViewModelFactory factory);

  @Binds
  @IntoMap
  @ViewModelKey(RedPackViewModel.class)
  abstract ViewModel bindRedPackViewModel(RedPackViewModel redPackModule);

  @Binds
  @IntoMap
  @ViewModelKey(OauthViewModel.class)
  abstract ViewModel  bindOauthViewModel(OauthViewModel oauthViewModel);

  @Binds
  @IntoMap
  @ViewModelKey(ProfileViewModel.class)
  abstract ViewModel  bindProfileViewModel(ProfileViewModel profileViewModel);


  @Binds
  @IntoMap
  @ViewModelKey(WalletViewModel.class)
  abstract ViewModel  bindWalletViewModel(WalletViewModel walletViewModel);



}
